<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fnx" uri="http://java.sun.com/jsp/jstl/functionsx"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <script type="text/javascript">
      $(function() {
        $("#sortHead").headSort();
      });
    </script>
</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<div class="content-header">
    <h1><s:message code="invite_code.management"/> - <s:message code="list"/> <small>(<s:message code="totalElements" arguments="${pagedList.totalElements}"/>)</small></h1>
</div>
<div class="content">
    <div class="box box-primary">
        <div class="box-body table-responsive">
            <div class="btn-group">
                <button class="btn btn-default" type="button"
                        onclick="location.href='list.do';"><s:message
                        code="return"/></button>
            </div>
                <tags:search_params/>
                <table id="pagedTable" class="table table-condensed table-bordered table-hover ls-tb">
                    <thead id="sortHead" pagesort="<c:out value='${page_sort[0]}' />" pagedir="${page_sort_dir[0]}" pageurl="code_dev_list.do?page_sort={0}&page_sort_dir={1}&${searchstringnosort}">
                    <tr class="ls_table_th">
                        <%--<th width="25"><input type="checkbox" onclick="Cms.check('ids',this.checked);"/></th>--%>
                        <th width="30" class="ls-th-sort"><span>ID</span></th>
                        <th class="ls-th-sort"><span><s:message code="invite_code.time"/></span></th>
                        <th class="ls-th-sort"><span><s:message code="invite_code.deviceId"/></span></th>
                        <th class="ls-th-sort"><span class="ls-sort"  pagesort="city">城市</span></th>
                        <th class="ls-t h-sort"><span><s:message code="invite_code.invitationCode"/></span></th>

                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="bean" varStatus="status" items="${pagedList.content}">
                            <tr>
                                <%--<td><input type="checkbox" name="ids" value="${bean.id}"/></td>--%>
                                <td align="center"><c:out value="${bean.id}"/></td>
                                <td align="center"><c:out value="${bean.time}"/></td>
                                <td align="center"><c:out value="${bean.deviceId}"/></td>
                                <td align="center"><c:out value="${bean.codeId.city}"/></td>
                                <td align="center"><c:out value="${bean.codeId.invitationCode}"/></td>
                            </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <c:if test="${fn:length(pagedList.content) le 0}">
                    <div class="ls-norecord"><s:message code="recordNotFound"/></div>
                </c:if>
            <form action="code_dev_list.do" method="get" class="ls-page">
                <f:hidden name="codeId" value="${codeId}"/>
                <tags:search_params excludePage="true"/>
                <tags:pagination pagedList="${pagedList}"/>
            </form>
        </div>
    </div>
</div>
</body>
</html>